package com.feicheng.common.mt;

import com.meituan.sdk.DefaultMeituanClient;
import com.meituan.sdk.MeituanClient;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

@Data
@PropertySource(value = {"classpath:mt.properties"}, encoding = "UTF-8")
@Component
public class MtClientConfigration {

    @Value("${developerId}")
    private Long developerId;

    @Value("${signKey}")
    private String signKey ;

    @Bean
    public MeituanClient getMeituanClient() {
        return DefaultMeituanClient.builder(developerId, signKey).build();
    }
}
